﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.member;
using System.Web.Security;
namespace Zebra.Umbraco.Marcos.MailList
{
    public partial class MailListChecker : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (DataClasses1DataContext db = new DataClasses1DataContext())
            {

                if (db.surveyMailLists.Count(c => c.Name == Request["MLName"] && c.NodeID == int.Parse(Membership.GetUser().ProviderUserKey.ToString())) != 0)
                {
                    Response.StatusCode = 200;
                }
                else
                {
                    Response.StatusCode = 404;
                }
                Response.End();
            }
        }
    }
}